﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoungeRepo.Contracts.Normalizer;

namespace Test.LoungeRepo.Serialization
{
    [Serializable]
    class SomeNormalizedEntity : INormalizedEntity
    {
        [Serializable]
        private class SomeNormalizedField : INormalizedField
        {
            #region Implementation of INormalizedField
            public string Name {get; set;}
            public object Value {get; set;}
            #endregion
        }

        #region Implementation of ILoungeRepoEntityIdentity
        public string Id {get;set;}
        public string Partition {get;set;}
        #endregion

        #region Implementation of INormalizedObject

        public string RefId
        {
            get { return this.Partition + this.Id; }
        }

        public Type ObjectType
        {
            get { return typeof (string); }
        }

        public IEnumerable<INormalizedField> Fields
        {
            get
            {
                return new INormalizedField[]
                           {
                               new SomeNormalizedField{Name="f1", Value=this.Id},
                               new SomeNormalizedField{Name="f2", Value=this.Partition}
                           };
            }
        }
        #endregion
    }

}
